package com.wendu.单例模式.改进懒汉式;

public class Test {
    public static void main(String[] args) throws ClassNotFoundException {
        Class.forName("com.wendu.单例模式.改进懒汉式.Instance");
        System.out.println("-----------------");
        Instance instance1 = Instance.getInstance();
        Instance instance2 = Instance.getInstance();
        System.out.println(instance1 == instance2);
//        for(int i = 0;i < 10;i++){
//            new Thread(new Runnable() {
//                @Override
//                public void run() {
//                    Instance.getInstance();
//                }
//            }).start();
//
//        }

    }
}
